import Vue from 'vue'
import Router from 'vue-router'
import Index from './views/Index.vue'
// var  Goods = () => {import ("./views/Goods.vue")}
// import Goods from './views/Goods.vue'
Vue.use(Router)

export default new Router({
  linkActiveClass:'active',
  linkExactActiveClass:'active',
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Index
    },
    {
      path:'/',
      redirect: 'home'
    },
    {
      path:'/goods',
      name:'goods',
      component: () => import ("./views/Goods.vue")
    },
    {
      path:'/details',
      name:'details',
      component: () => import ("./views/details.vue")
    },
    {
      path:'/cart',
      name:'cart',
      component: () => import ("./views/Cart.vue")
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ]
})
